var appVue=new Vue({
  el: '#merchantApp',
  data: {
	current:1,
	size:10,
	merchantList:[]
  },
  mounted:function(){
	  //模版编译/挂载之后执行
	  this.getMerchantList();
  },
  methods:{
	  getMerchantList(){
		  //查询商户,将this指针指向_self对象，方便后续调用
		  var _self=this;
		  $.ajax({
		        url: appConfig.apiUrl+"/merchant/list",
		        type: "post",
		        data:{
		        	pageNo:_self.current,
		        	pageSize:_self.size
		        },
		        dataType: 'json',
		        success: function(data) {
		        	var result=data.body;
		        	var records=result.records;
		        	var pages=result.pages;
		        	var current=result.current;
		        	_self.merchantList=records;
		        	//初始化分页
	        	    laypage({
	        		  cont: $('#pagination'), //容器。值支持id名、原生dom对象，jquery对象,
	        		  pages: pages, //总页数
	        		  curr:current,
	        		  skip: true, //是否开启跳页
	        		  skin: 'molv',
	        		  groups: 3, //连续显示分页数
	        		  jump: function(obj,first){
	        			  if(!first){
	        				  _self.current=obj.curr;
	        				  _self.getMerchantList();
	        			  }
	        		  }
	        		});
		        },
		        error: function() {
		            alert("超时");
		        }
		    });
	  }
  }
})